{% stylesheet %}

.block_html img {
  max-width: 100%;
}

{% endstylesheet %}
{%- capture warp_class -%}
  {%- if section.settings.fullScreen -%}full_container_wrapper{%- else -%}container_wrapper
  {%- endif -%}
{%- endcapture -%}
<div class="block_html {{warp_class}}">
  {% if section.settings.title != '' %}
    <div class="block_title">
        <h2>{{ section.settings.title }}</h2>
    </div>
  {% endif %}
  {{ section.settings.html }}
</div>

{% schema %}
{
	"name": {
		"zh_CN": "自定义",
		"en_US": "Custom"
	},
	"tag": "section",
	"class": "block_html",
	"is_global": false,
	"settings": [
		{
			"type": "card_header",
			"id": "",
			"label": {
				"zh_CN": "自定义",
				"en_US": "Custom"
			}
		},
		{
			"type": "card_input",
			"label": {
				"zh_CN": "标题",
				"en_US": "Title"
			},
			"id": "title"
		},
		{
			"type": "card_switch",
			"label": {
				"zh_CN": "宽度铺满",
				"en_US": "Spread the width"
			},
			"id": "fullScreen"
		},
		{
			"type": "card_textarea",
			"id": "html",
			"label": {
				"zh_CN": "HTML",
				"en_US": "HTML"
			},
			"placeholder": {
				"zh_CN": "请输入代码",
				"en_US": "Please enter the code"
			}
		}
	],
	"blocks": [],
	"default": {
		"settings": {
			"title": "",
			"html": "<div style=\"text-align:center;background: #f6f6f6;padding: 40px 0;\"><h3 style=\"margin-bottom:20px\">Heading</h3><p>Body content</p></div>",
			"fullScreen": false
		},
		"blocks": []
	},
	"icon": "icon-zidingyi1"
}
{% endschema %}